package com.tuanzi.loan.web.lazy.system;

import org.springframework.data.domain.Page;

import com.tuanzi.loan.business.service.system.ScheduleService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.system.ScheduleSearchRequest;
import com.tuanzi.loan.vo.response.system.ScheduleSearchResponse;

/**
 * @author Ray 2017/09/21
 */
public class ScheduleLazyDataModel extends BaseLazyDataModel<ScheduleSearchRequest, ScheduleSearchResponse> {

	private static final long serialVersionUID = 9143007553234885156L;

	private ScheduleService scheduleService = SpringContextHolder.getBean(ScheduleService.class);

	public ScheduleLazyDataModel(ScheduleSearchRequest searchRequest) {
		super(searchRequest);
	}

	@Override
	protected Page<ScheduleSearchResponse> doLoad(PageSearcher<ScheduleSearchRequest> pageSearcher) {
		return scheduleService.list(pageSearcher);
	}
}
